package com.itheima;

import javax.swing.*;

public class Game {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Ground ground = new Ground();
        GamePanel gamePanel = new GamePanel();
        Controller controller = new Controller(shapeFactory, ground, gamePanel);
        JFrame jFrame = new JFrame();
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jFrame.setTitle("黑马-俄罗斯方块");
        jFrame.setResizable(false);
        jFrame.setSize(gamePanel.getWidth() + 10, gamePanel.getHeight() + 35);
        jFrame.add(gamePanel);
        //       gamePanel.addKeyListener(controller);
        jFrame.addKeyListener(controller);
        jFrame.setVisible(true);
        controller.newGame();
    }
}
